﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>班牌机</title>
<link rel="stylesheet" href="/scriptZIP/layui.min.css">
	<link rel="stylesheet" href="/css/common2.css">
	<style>
		.layui-row {
			margin-top: 50px;
		}

		.offer {
			width: 90px;
			height: 35px;
			background: #0086b6;
			color: white;
			text-align: center;
			line-height: 35px;
			font-size: 16px;
			border-radius: 4px;
		}

		.return {
			width: 80px;
			height: 35px;
			background: #0086b6;
			color: white;
			text-align: center;
			line-height: 35px;
			margin-top: -35px;
			margin-left: 130px;
			font-size: 16px;
			border-radius: 4px;
		}
	</style>
</head>

<body>
	
	<div class="layui-row" id="vue-root">
		<div class="layui-col-md6 layui-col-md-offset3">

			<div class="layui-form-item">
				<label class="layui-form-label">班级名称</label>
				<div class="layui-input-block">
					<select name="classesName" v-validate="'required'" class="layui-input school"
						v-model="item.classesId">
						<option :value="undefined" disabled="disabled">请选择班级</option>
						<option v-for="classes in classess" :key="classes.id" :value="classes.id" v-text="classes.name">
						</option>
					</select>
					<div class="checkout_state" v-text="err('classesName')"></div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">设备名称</label>
				<div class="layui-input-block">
					<input name="boardName" v-validate="'required'" autocomplete="off" placeholder="请输入设备名称"
						class="layui-input name" v-model="item.name">
					<div class="checkout_state" v-text="err('boardName')"></div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">设备编码</label>
				<div class="layui-input-block">
					<input name="boardCode" v-validate="'required'" autocomplete="off" placeholder="请输入设备编码"
						class="layui-input tag" v-model="item.code">
					<div class="checkout_state" v-text="err('boardCode')"></div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<div class="offer" @click="submit">立即提交</div>
					<div class="return" onclick="history.back()">取消</div>
				</div>
			</div>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	
	
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/item.js"></script>

	<script>
		var app = new Vue(merge({
			data: {
				classess: [],
				url: '/pc/board',
			},
			created: function () {
				axios.get('/pc/classes/all/' + top_params().id).then(function (res) {
					this.classess = res.data;
				}.bind(this));
				this.init();
			},
			methods: {
				formatData: function (data) {
					axios.get('/pc/classes/' + data.classesId).then(function (res) {
						this.schoolId = res.data.schoolId;
					}.bind(this));
				}
			}
		}));
	</script>


</body>

</html>